//
//  videodetailview.m
//  iNews
//
//  Created by lanou3g on 14-12-6.
//  Copyright (c) 2014年 张在青. All rights reserved.
//

#import "videodetailview.h"

@implementation videodetailview

- (void)dealloc
{
    [_vdLabel release];
    [_vdTab release];
    [_vdtialView release];
    [_button release];
    [_firstButton release];
    [_secondbutton release];
    [_vdview release];
    [_hafView release];
    [super dealloc];
}

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        
        [self addviews];
    }
    return self;
}

-(void)addviews{
    
  //初始化vdtialview
    self.vdtialView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, 260)] autorelease];
    
    //self.vdtialView.backgroundColor = [UIColor yellowColor];
    
    [self addSubview:self.vdtialView];
    
    //初始化返回button
    self.button = [UIButton buttonWithType:UIButtonTypeSystem];
    self.button.frame = CGRectMake(20, 20, 40, 40);
    [self.button setBackgroundImage:[UIImage imageNamed:@"bobo_top_navigation_back_highlighted@2x.png"] forState:UIControlStateNormal];
    [self addSubview:self.button];
    
    //初始化一个一半的hafview
    
    self.hafView = [[[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.vdtialView.frame), CGRectGetWidth(self.vdtialView.frame), [UIScreen mainScreen].bounds.size.height - CGRectGetHeight(self.vdtialView.frame) - 40)] autorelease];
    
    //self.hafView.backgroundColor = [UIColor redColor];
    
    [self addSubview:self.hafView];
    
    
    
    //初始化一个vdview
    self.vdview = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.hafView.frame), 30)] autorelease];
    
    self.vdview.backgroundColor = [UIColor whiteColor];
    [self.hafView addSubview:self.vdview];
    
    //初始化一个label
    self.vdLabel = [[[UILabel alloc] initWithFrame:CGRectMake(140, 8, 30, 14)] autorelease];
    self.vdLabel.text = @"推荐";
    self.vdLabel.textColor = [UIColor redColor];
    self.vdLabel.font = [UIFont systemFontOfSize:12];
    self.vdLabel.textAlignment = NSTextAlignmentCenter;
    [self.vdview addSubview:self.vdLabel];
    
    //
    self.secondbutton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.secondbutton.frame = CGRectMake(self.vdview.frame.size.width - 30, 10, 20, 10);
    [self.secondbutton setBackgroundImage:[UIImage imageNamed:@"calendar_switch_down@2x.png"] forState:UIControlStateNormal];
    
    [self.vdview addSubview:self.secondbutton];
    
    //初始化第一个button
    self.firstButton = [UIButton buttonWithType:UIButtonTypeSystem];
    self.firstButton.frame = CGRectMake(self.vdview.frame.size.width - 30, 10, 20, 10);
    
    [self.firstButton setBackgroundImage:[UIImage imageNamed:@"calendar_switch_up@2x.png"] forState:UIControlStateNormal];
    [self.vdview addSubview:self.firstButton];
    self.secondbutton.hidden = YES;
    
    //创建一个底部view
    self.dropview = [[[UIView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.vdview.frame), CGRectGetWidth(self.vdview.frame), CGRectGetHeight(self.hafView.frame) - CGRectGetHeight(self.vdview.frame))] autorelease];
   //self.dropview.backgroundColor = [UIColor greenColor];
    [self.hafView addSubview:self.dropview];
    
    //定义一个imageview添加在dropview上
    UIImageView *imageview = [[[UIImageView alloc] initWithImage:[UIImage imageNamed: @"video_play_big@2x.png"]] autorelease];
    imageview.frame = CGRectMake(120, 30, 60, 60);
    [self.dropview addSubview:imageview];
    
    //
    UILabel *messageLabel = [[[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(imageview.frame), CGRectGetMaxY(imageview.frame),90, 40)] autorelease];
    
    messageLabel.text = @"暂无推荐视频再去看看别的吧";
    messageLabel.font = [UIFont systemFontOfSize:12];
    messageLabel.numberOfLines = 0;
    [self.dropview addSubview:messageLabel];
    
    
    
    
    //初始化一个tabview
    self.vdTab = [[[UITableView alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.vdview.frame), CGRectGetWidth(self.vdview.frame), CGRectGetHeight(self.hafView.frame) - CGRectGetHeight(self.vdview.frame)) style:UITableViewStyleGrouped] autorelease];
    self.vdTab.backgroundColor = [UIColor whiteColor];
    [self.hafView addSubview:self.vdTab];
    
    
    
    
    
    
}




@end
